﻿using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Text;
using System.Xml;
using SharppiFlowEditor.models;
using SharppiFlowEditor.views;

namespace SharppiFlowEditor.controllers
{
    public class OpenDocumentController : AbstractController
    {

        public OpenDocumentController(AppView appView, AppModel appModel)
        {
            Model = appModel;
            View = appView;
        }

        public void Open(Stream fileContent)
        {
            Document d = Model.openDocument(fileContent);
            View.document.GraphDocument = d;
            View.DocPropView.SelectedDocument = View.document.GraphDocument;
            View.DocPropView.updatePropertiesView();
        }
    }
}
